Skip to content

Add workflow to test code coverage and generate coverage report#24

Merged
stevenhartley merged 6 commits intoeclipse-uprotocol:mainfrom
neelam-kushwah:main
Apr 11, 2024
Merged

Add workflow to test code coverage and generate coverage report#24
stevenhartley merged 6 commits intoeclipse-uprotocol:mainfrom
neelam-kushwah:main

Conversation

@neelam-kushwah
Copy link
Contributor

@neelam-kushwah neelam-kushwah commented Apr 6, 2024

This PR addresses #4 , #23 which is to add a GitHub Actions workflow (coverage.yml) . The workflow runs on pull requests targeting the main branch and consists of a job named test-and-coverage. The job runs tests with coverage enabled, generates an HTML coverage report, and uploads the report as an artifact. Additionally, the workflow comments on the pull request with the coverage results.

This commit adds a GitHub Actions workflow (`coverage.yml`) . The workflow runs on pull requests targeting the `main` branch and consists of a job named `test-and-coverage`. The job runs tests with coverage enabled, generates an HTML coverage report, and uploads the report as an artifact. Additionally, the workflow extracts the pull request title and description and comments on the pull request with the coverage results.
@neelam-kushwah
Copy link
Contributor Author

Screenshot 2024-04-06 163157

@stevenhartley
In my repo, the workflow can comment on PRs with code coverage details, but it's not working here, possibly due to permission issues. I've temporarily removed the comment step, but it'd be great to fix this.

neelam-kushwah and others added 4 commits April 6, 2024 20:19
With these new tests, we were able to increase code coverage to 98%. Along with this, we provided some linting improvements, as well as fixed a few methods that were implemented incorrectly in a previous PR.
Current system does not support tool.coverage.report, so I have removed it for now. Those exclusion cases will be covered in the coverage.rc file
@neelam-kushwah
Copy link
Contributor Author

Commenting on PR is a known issue and limitation of GitHub actions when running for pull requests coming from a fork, see https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/4527#note_2084764
There are workarounds for that, but they also have security implications as pull requests from forks potentially contain malicious code. Hence removed the comment on PR step from workflow.

@stevenhartley
Copy link

Per offline discussion, the open issue with adding notes to the PR will be addressed in a subsequent issue

@stevenhartley stevenhartley merged commit 8fe0f6f into eclipse-uprotocol:main Apr 11, 2024
This was linked to issues Jul 31, 2024
@neelam-kushwah neelam-kushwah self-assigned this Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Create a workflow for code coverage SDK Test coverage

3 participants